package com.youlu.campus.entity.enums;

/**
 * 证书材质
 */
public enum CaMaterialType {
    PAPER("纸质版", 1), DIGIT("电子版", 0);
    // 成员变量
    private String name;
    private int type;

    // 构造方法
    private CaMaterialType(String name, int type) {
        this.name = name;
        this.type = type;
    }

    // 普通方法
    public static String getName(int type) {
        for (CaMaterialType c : CaMaterialType.values()) {
            if (c.getType() == type) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
}
